from pymongo import MongoClient  # type: ignore[import-untyped]


def clean_mongodb(mongoip, mongoport, mongouser, mongopwd):
    """
    清空lianjimongo库的数据
    :param mongoip:
    :param mongoport:
    :param mongouser:
    :param mongopwd:
    :return:
    """
    client = MongoClient(mongoip, mongoport, username=mongouser, password=mongopwd)
    db = client["data_support"]
    db["defect_entity_838001_0"].delete_many({})
    db["defect_entity_871901_0"].delete_many({})

    db["entity_more_838001_0"].delete_many({})

    db["entity_nei_rong_li_jie_ren_yuan_xin_xi_838001_0"].delete_many({})
    db["entity_she_jiao_ruan_jian_qun_mo_xing_871901_0"].delete_many({})

    db["trace_entity_838001_0"].delete_many({})
    db["trace_entity_871901_0"].delete_many({})

    db["def_870801_1"].delete_many({})
    db["def_870802_1"].delete_many({})
    db["def_870803_1"].delete_many({})
    db["def_870804_1"].delete_many({})
    db["def_870805_1"].delete_many({})
    db["def_870806_1"].delete_many({})
    db["def_870809_1"].delete_many({})
    db["def_873801_1"].delete_many({})
    db["def_873802_1"].delete_many({})
    db["def_873803_1"].delete_many({})
    db["def_873804_1"].delete_many({})
    db["def_873805_1"].delete_many({})
    db["def_873806_1"].delete_many({})
    db["def_873807_1"].delete_many({})
    db["def_900501_1"].delete_many({})
    db["def_907701_1"].delete_many({})
    db["def_907702_1"].delete_many({})
    db["def_926201_1"].delete_many({})
    db["def_926202_1"].delete_many({})
    db["def_1059201_1"].delete_many({})
    db["def_1058002_1"].delete_many({})

    db["trace_rel_870801_1"].delete_many({})
    db["trace_rel_870802_1"].delete_many({})
    db["trace_rel_870803_1"].delete_many({})
    db["trace_rel_870804_1"].delete_many({})
    db["trace_rel_870805_1"].delete_many({})
    db["trace_rel_870806_1"].delete_many({})
    db["trace_rel_870809_1"].delete_many({})
    db["trace_rel_873801_1"].delete_many({})
    db["trace_rel_873802_1"].delete_many({})
    db["trace_rel_873803_1"].delete_many({})
    db["trace_rel_873804_1"].delete_many({})
    db["trace_rel_873805_1"].delete_many({})
    db["trace_rel_873806_1"].delete_many({})
    db["trace_rel_873807_1"].delete_many({})
    db["trace_rel_900501_1"].delete_many({})
    db["trace_rel_907701_1"].delete_many({})
    db["trace_rel_907702_1"].delete_many({})
    db["trace_rel_926201_1"].delete_many({})
    db["trace_rel_926202_1"].delete_many({})
    db["trace_rel_1059201_1"].delete_many({})
    db["trace_rel_1058002_1"].delete_many({})

    db["defect_rel_trace_870801_1"].delete_many({})
    db["defect_rel_trace_870802_1"].delete_many({})
    db["defect_rel_trace_870803_1"].delete_many({})
    db["defect_rel_trace_870804_1"].delete_many({})
    db["defect_rel_trace_870805_1"].delete_many({})
    db["defect_rel_trace_870806_1"].delete_many({})
    db["defect_rel_trace_870809_1"].delete_many({})
    db["defect_rel_trace_873801_1"].delete_many({})
    db["defect_rel_trace_873802_1"].delete_many({})
    db["defect_rel_trace_873803_1"].delete_many({})
    db["defect_rel_trace_873804_1"].delete_many({})
    db["defect_rel_trace_873805_1"].delete_many({})
    db["defect_rel_trace_873806_1"].delete_many({})
    db["defect_rel_trace_873807_1"].delete_many({})
    db["defect_rel_trace_900501_1"].delete_many({})
    db["defect_rel_trace_907701_1"].delete_many({})
    db["defect_rel_trace_907702_1"].delete_many({})
    db["defect_rel_trace_926201_1"].delete_many({})
    db["defect_rel_trace_926202_1"].delete_many({})
    db["defect_rel_trace_1059201_1"].delete_many({})
    db["defect_rel_trace_1058002_1"].delete_many({})

    db["cu_merge_def_info"].delete_many({})
    db["cu_merge_neo4j_node_info"].delete_many({})
    db["cu_merge_node_info"].delete_many({})

    client.close()
